package com.gitee.xzb617.mybatis.query.condition;

import java.util.HashMap;
import java.util.Map;

/**
 * 查询条件
 * @author: XuZhibin
 * @date: 2023/12/29 15:26
 * @version: v1.0
 * @attention: 增加对日期格式查询的支持
 */
public class QueryCondition {

    private Map<String, Object> commonConditionMap = new HashMap<>();

    private Map<String, DateCondition> dateConditionMap = new HashMap<>();

    public static QueryCondition create() {
        return new QueryCondition();
    }

    public Map<String, Object> getCommonConditionMap() {
        return commonConditionMap;
    }

    public Map<String, DateCondition> getDateConditionMap() {
        return dateConditionMap;
    }

    public QueryCondition addCondition(String column, Object value) {
        this.commonConditionMap.put(column, value);
        return this;
    }

    public QueryCondition addDateCondition(String column, DateCondition dateCondition) {
        this.dateConditionMap.put(column, dateCondition);
        return this;
    }

}
